package org.database.config;

import com.mybatisflex.core.mybatis.FlexConfiguration;
import com.mybatisflex.spring.boot.ConfigurationCustomizer;
import org.apache.ibatis.logging.stdout.StdOutImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;

/**
 * MyConfigurationCustomizer
 *
 * @author grl
 * @date 2024/1/11
 */
@Configuration
@ConditionalOnProperty(value = "mybatis-flex.logging.enable", havingValue = "true")
public class MybatisFlexLoggingConfiguration implements ConfigurationCustomizer {

    @Override
    public void customize(FlexConfiguration configuration) {
        configuration.setLogImpl(StdOutImpl.class);
    }
}